Windows Registry and Shortcuts
Previous  Top  Next



Use the following commands and functions to access the Windows registry and create Windows shortcuts.

Commands:

^!ClearRegValue
[BaseRoot\]Key[:Name] (added in v4.8)
Deletes the specified name or key in the Windows Registry. If BaseRoot is not defined, then HKEY_CURRENT_USER is used. If a Name is specified, then only that name will be deleted from the Registry. If no Name is specified (no colon), then the key and all Names under it will be deleted. Use with care!
Version 4.83: if the Key value contains a colon, the Clip interpreter will incorrectly assume it marks the limit between the Key and Name elements. To remedy this situation, use a double colon after the key name. Example:
^!ClearRegValue HKEY_CURRENT_USER\Software\c:Beta::UserName=Raymond


BaseRoot can be any of the following values:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS

^!MakeShortcut ShortcutLocation "Target" ["Arguments"] ["Description"] [CmdShow] (added in v4.8)
Creates Windows shortcuts. Syntax:
· ShortcutLocation is the place where the shortcut is created. It accepts the same values as the TypeFolder argument used in the ^$GetSpecialPath(TypeFolder)$ function. - "Target" is the program to execute, or the document to launch.  
· "Arguments" are eventual command-line switches you might want to use with the target program.  
· "Description" is an optional parameter you can use to identify the shortcut. If it is left blank, the shortcut name will be the same as the target program name.  
· CmdShow defines how the program is opened. It can have one of the following values:  
    Normal (default if no value specified)
    Maximized
    Minimized
Example:
^!MakeShortcut SendTo "^$GetAppFileName$" "" "Open in NoteTab" MAXIMIZED

^!SaveRegValue [BaseRoot\]Key[:Name]=Value (added in v4.8)
Saves the specified value under the key entry in the Windows Registry. If BaseRoot is not defined, then HKEY_CURRENT_USER is used. If no value is specified for Name, the "(Default)" name is used. The maximum amount of text that can be saved this way is 1024 characters. Use with care! Example based on ^$GetRegValue$ example:
^!SaveRegValue HKEY_CURRENT_USER\Software\Beta:UserName=Raymond
^!SaveRegValue Control Panel\International:sDate=/
^!SaveRegValue HKEY_CLASSES_ROOT\.386=vxdfile

Version 4.83: if the Key value contains a colon, the Clip interpreter will incorrectly assume it marks the limit between the Key and Name elements. To remedy this situation, use a double colon after the key name. Example:
^!SaveRegValue HKEY_CURRENT_USER\Software\c:Beta::UserName=Raymond



Functions:

^$ExpandEnv("Str")$ (added in v4.9)
This function expands environment-variable strings and replaces them with their defined values. Example (under Windows XP):
^$ExpandEnv("%systemroot%")$
-> "C:\WINDOWS"

Predefined system variables under Windows 2000 and XP:
ComputerName  
ComSpec  
HomeDrive  
HomePath  
HomeShare  
LogonServer  
Number_Of_Processors  
OS  
Os2LibPath  
Path  
PathExt  
Processor_Architecture  
Processor_Identifier  
Processor_Level  
Processor_Revision  
Prompt  
SystemDrive  
SystemRoot  
UserDomain  
UserName  
UserProfile  
WinDir  

^$GetRegValue("[BaseRoot\]Key[:Name]")$ (added in v4.8)
Returns the value stored under the specified key in the Windows Registry. If BaseRoot is not defined, then HKEY_CURRENT_USER is used. If no value is specified for Name, the "(Default)" name is used. Returns an empty string if the key does not exist. Example:
^$GetRegValue(HKEY_CURRENT_USER\Software\Beta:UserName)$
-> Raymond
^$GetRegValue(Control Panel\International:sDate)$
-> /
^$GetRegValue(HKEY_CLASSES_ROOT\.386)
$ -> vxdfile
Version 4.83: if the Key value contains a colon, the Clip interpreter will incorrectly assume it marks the limit between the Key and Name elements. To remedy this situation, use a double colon after the key name. Example:
^$GetRegValue(HKEY_CURRENT_USER\Software\c:Temp::Folder)$


^$GetShellFolder(SystemFolder)$ (added in v4.9)
Returns the path to the specified folder type "SystemFolder". The folder name always ends with a backslash. See below for SystemFolder values and an example for each value of a corresponding path (under Windows 98):

Desktop --> C:\WINDOWS\Desktop\
Templates --> C:\WINDOWS\ShellNew\
AppData --> C:\WINDOWS\Application Data\
Start Menu --> C:\WINDOWS\Start Menu\
Programs --> C:\WINDOWS\Start Menu\Programs\
Startup --> C:\WINDOWS\Start Menu\Programs\StartUp\
Fonts --> C:\WINDOWS\Fonts\
SendTo --> C:\WINDOWS\SendTo\
Recent --> C:\WINDOWS\Recent\
Favorites --> C:\WINDOWS\Favorites\
NetHood --> C:\WINDOWS\NetHood\
Personal --> C:\WINDOWS\My Documents\
Cache --> C:\WINDOWS\Temporary Internet Files\
Cookies --> C:\WINDOWS\Cookies\
History --> C:\WINDOWS\History\
PrintHood --> C:\WINDOWS\PrintHood\
Local AppData --> C:\WINDOWS\Local Settings\Application Data\
My Pictures --> C:\WINDOWS\My Documents\My Pictures\
Administrative Tools -->
C:\WINDOWS\Start Menu\Programs\Administrative Tools\

^$GetSpecialPath(TypeFolder)$ (added in v4.8)
Returns the path name of the specified Windows folder. TypeFolder can have one of the following values:
   AppFolder
   Desktop
   DesktopDir
   StartMenu
   Programs
   Startup
   SendTo
   Favorites
   Recent
   CommonDesktopDir
   CommonStartMenu
   CommonPrograms
   CommonStartup
   CommonFavorites